package masterlink.sarPoint.util;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
public class NumUtil {
	private static final String format="HH:mm:ss";
	private static final DateFormat df=new SimpleDateFormat(format);
	private static final DecimalFormat nf=new DecimalFormat("#0.##");
	private static final DecimalFormat tnf=new DecimalFormat("#,##0.####");
	public static String formatNumber(Number num){
		if(num==null){
			return nf.format(0);
		}else if(num instanceof Float || num instanceof Double){
			return nf.format(num.doubleValue());
		}else{
			return nf.format(num.longValue());
		}
	}
}
